from time import sleep
from class1905A.zoukao.zoukao2.BasePage import BasePage
from selenium.webdriver.common.by import By
class FengzPage1(BasePage):
    qunaerdl_slo = (By.XPATH,'//*[@id="__headerInfo_login__"]')  #点击登录
    qunaerdl1_slo = (By.XPATH,'//*[@id="app"]/div/div[2]/div/div[1]/div[4]/input')#勾选协议
    qunaerdl2_slo = (By.CLASS_NAME, 'desc')#点击其他方式登录
    qunaerdl3_slo = (By.CLASS_NAME, 'img')  # 点击QQ登录
    qunaerdl4_slo = (By.ID, 'ptlogin_iframe')  # 进入框架
    qunaerdl5_slo = (By.CLASS_NAME, 'link')  # 点击账号密码登录
    qunaerdl6_slo = (By.ID, 'u')  # 输入账号
    qunaerdl7_slo = (By.ID, 'p')  # 输入密码
    qunaerdl8_slo = (By.ID, 'login_button')  # 点击验证并登录
    jipiaoss_slo = (By.XPATH, '//*[@id="js_nva_cgy"]/li[1]/a')  # 点击机票
    jipiaoss1_slo = (By.CLASS_NAME, 'qcbox-placeholder')  #输入到达目的地
    jipiaoss2_slo = (By.CLASS_NAME, 'p_btn')  # 点击搜索
    def dengl(self):
        self.find_element(*self.qunaerdl_slo).click()#点击登录
    def dengl1(self):
        self.find_element(*self.qunaerdl1_slo).click()  #勾选协议
    def dengl2(self):
        self.find_element(*self.qunaerdl2_slo).click()  #点击其他方式登录
    def dengl3(self):
        self.find_element(*self.qunaerdl2_slo).click()  #点击QQ登录
    def dengl4(self):
        self.driver.switch_to.frame(self.driver.find_element(*self.qunaerdl4_slo))# 进入框架
    def dengl5(self):
        self.find_element(*self.qunaerdl5_slo).click()  #点击账号密码登录
    def dengl6(self):
        self.find_element(*self.qunaerdl6_slo).send_keys('1547786171')  # 输入账号
    def dengl7(self):
        self.find_element(*self.qunaerdl7_slo).send_keys('chenxinyang.0827')  # 输入密码
    def dengl8(self):
        self.find_element(*self.qunaerdl8_slo).click()  # 点击验证并登录
    def jpss(self):
        self.find_element(*self.jipiaoss_slo).click()  # 点击机票
    def jpss1(self):
        self.find_element(*self.jipiaoss1_slo).send_keys('南宁')# 输入目的地

    def jpss2(self):
        self.find_element(*self.jipiaoss2_slo).click()# 点击立即搜索


    def qunaer_zhixing(self):
        self.driver.get('https://www.qunar.com/')
        sleep(2)
        self.driver.maximize_window()
        sleep(2)
        # self.dengl()
        # sleep(2)
        # self.dengl1()
        # sleep(2)
        # self.dengl2()
        # sleep(2)
        # self.dengl3()
        # sleep(2)
        # self.dengl4()
        # sleep(2)
        # self.dengl5()
        # sleep(2)
        # self.dengl6()
        # self.dengl7()
        # sleep(2)
        # self.dengl8()
        # sleep(2)
        # self.jpss()
        # sleep(2)
        # self.jpss1()
        # sleep(2)
        # self.jpss2()
        # sleep(2)